# -*- coding:utf-8 -*-
# @Author    : g1879
# @date      : 2020-12-22
# @email     : g1879@qq.com
from ListPage import Paths, Targets, ListPage, Recorder

url = 'http://zfcg.gxzf.gov.cn/reformColumn/ZcyAnnouncement10016/index.html'

paths = Paths('css')
paths.rows = 'div.list-container li'
paths.set_col('标题', 'a')
paths.next_btn = 'li[title="Next page"]>a'
paths.pages_count = 'li.paginationjs-page.paginationjs-last.J-paginationjs-page'

targets = Targets(paths)
targets.add_target('标题', '标题', 'title')
targets.add_target('链接', '标题', 'href')

# 定义记录器
recorder = Recorder('广西政府采购网.csv', 200)

page = ListPage(paths, url, 'd')
print(page.pages_count)

page.get_list(targets, recorder=recorder, wait=1)
